package uabc.ia.agentelimpieza.vista;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Rectangle;

import uabc.ia.agentelimpieza.ambiente.Celda;

public class CeldaUI {
	private Celda celda;
	private int x;
	private int y;
	private int width;
	private int height;
	private boolean sucia;
	
	public CeldaUI(int x, int y, int width,int height){
		celda = new Celda(x/100,y/100,false);
		this.x=x;
		this.y=y;
		this.width=width;
		this.height=height;
	}

	public void update() {
		
	}

	public void paint(Graphics g) {
		g.setColor(Color.WHITE);
		g.fillRect(x, y, width, height);
		g.setColor(Color.BLACK);
		if(celda.isSuciedad())
			g.fillOval(x+(width/2)-10, y+(height/2)-10, 20, 20);
		g.drawRect(x, y, width, height);
	}
	
	public Rectangle getRectangle(){
		return new Rectangle(x,y,width,height);
	}

	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}

	public boolean isSucia() {
		return sucia;
	}

	public void setSucia(boolean sucia) {
		this.sucia = sucia;
		celda.setSuciedad(sucia);
	}
	
	public void setCelda(Celda celda){
		this.celda=celda;
	}
	
	public Celda getCelda(){
		return celda;
	}
}
